#ifndef GEOMETRIC_MESH
#define GEOMETRIC_MESH

#include "Geometric/Face.hpp"

#include <iostream>

namespace mif
{

	class Mesh
	{	
	
		public:		
		
			Mesh();	
			
			~Mesh();
			
			Vertex * GetVertex(int) const;
			
			Face * GetFace(int) const;
			
			int GetNbVertex() const;
			
			int GetNbEdge() const;
			
			int GetNbFace() const;
			
			
			void SetVertexListLength(int);
			
			void SetFaceListLength(int);
			
			void SetVertex(int, Vertex);
			
			void SetFace(int, int, int, int);
			
			
			Vertex * VertexBegin() const;
			
			Vertex * VertexEnd() const;
			
			Face * FaceBegin() const;
			
			Face * FaceEnd() const;
			
			
			void Show() const;
			
		private:
			
			int mNbVertex;
			int mNbEdge;
			int mNbFace;
			Vertex * mVertexList;
			Face * mFaceList;
			
		public:

			template <typename T>
			class iterator
			{
				public:

					iterator(T * p): mPtr(p)
					{
						//EMPTY
					}
				
					~iterator()
					{
						//EMPTY
					}
				
					T operator *()
					{
						return *mPtr;
					}
					
					T* operator ->()
					{
						return mPtr;
					}
				
					bool operator != (const iterator<T>& pIt)
					{
						return mPtr != pIt.mPtr;
					}

					bool operator == (const iterator<T>& pIt)
					{
						return mPtr == pIt.mPtr;
					}
				
					iterator<T>& operator ++()
					{
						++mPtr;
						return *this;
					}
				
					iterator& operator --()
					{
						mPtr--;
						return *this;
					}
				
				private:
				
					T * mPtr;

			};
		
	};

}

#endif
